<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY copy "&#169;">
  <!ENTITY nbsp "&#160;">
  <!ENTITY laquo "&#171;">
  <!ENTITY raquo "&#187;">
]>
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">


    <xsl:include href="../layout.xsl"/>

    <xsl:template match="/">
        <xsl:apply-templates />
    </xsl:template>

    <xsl:template match="content">
        <!--<script type="text/javascript" src="/js/region_cities.js" />-->


        <div class="contenthead">
            <xsl:call-template name="Create_Path">
                <xsl:with-param name="last" select="/page/content/Main/form/username"></xsl:with-param>
            </xsl:call-template>

            <div class="top">
                <span class="title">Редактор</span>
            </div>

        </div>

        <form action="" method="post" name="form" id="form" enctype="multipart/form-data">
    
            <div class="aside">
                <div class="head-slide on">
                    Настройки
                </div>

                <div class="container">
                    <ul class="editlist">  
                        <li>
                            <label>
                                <input type="checkbox" name="is_active" value="1">
                                    <xsl:if test="$User/role_id != 1 and $User/role_id != 12">
                                        <xsl:attribute name="onclick">return false</xsl:attribute>
                                        <xsl:attribute name="onkeydown">return false</xsl:attribute>
                                    </xsl:if>
                                    <xsl:if test="Main/form/is_active>0">
                                        <xsl:attribute name="checked">true</xsl:attribute>
                                    </xsl:if>
                                </input>
                                Активний
                            </label>
                        </li>  
                        <li>
                            <label>Область</label>

                            <select name="id_region" id="id_region">
                                <xsl:if test="not($Form/id_region/row) or ($User/role_id != 1 and $User/role_id != 12)">
                                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                                </xsl:if>
                                <option value="0">
                                    Не задано
                                </option>
                                <xsl:for-each select="$Form/id_region/row">
                                    <option value="{id}">
                                        <xsl:if test="@active">
                                            <xsl:attribute name="selected">selected</xsl:attribute>
                                        </xsl:if>
                                        <xsl:value-of select="name" /> (
                                        <xsl:value-of select="koatuu" />)
                                    </option>
                                </xsl:for-each>
                            </select>

                        </li>

                        <li>
                            <label>Район</label>

                            <select name="id_district" id="id_district">
                                <xsl:if test="not($Form/id_district/row) or ($User/role_id != 1 and $User/role_id != 12)">
                                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                                </xsl:if>
                                <option value="0">
                                    Не задано
                                </option>
                                <xsl:for-each select="$Form/id_district/row">
                                    <option value="{id}">
                                        <xsl:if test="@active">
                                            <xsl:attribute name="selected">selected</xsl:attribute>
                                        </xsl:if>
                                        <xsl:value-of select="name" /> (
                                        <xsl:value-of select="koatuu" />)
                                    </option>
                                </xsl:for-each>
                            </select>
                        </li>

                        <li hidden="true">
                            <label>Місто</label>

                            <select name="id_city" id="id_city">
                                <xsl:if test="not($Form/id_city/row) or (User/role_id != 1 and User/role_id != 12)">
                                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                                </xsl:if>
                                <option value="0">
                                    Не задано
                                </option>
                                <xsl:for-each select="$Form/id_city/row">
                                    <option value="{id}">
                                        <xsl:if test="@active">
                                            <xsl:attribute name="selected">selected</xsl:attribute>
                                        </xsl:if>
                                        <xsl:value-of select="name" />
                                    </option>
                                </xsl:for-each>
                            </select>
                        </li>
            
                        <li>
                            <label>КОАТУУ</label>                                     
                            <input name="koatuu" id="form_koatuu" type="text" value="{Main/form/koatuu}" class="broad100">
                                <xsl:if test="$User/role_id != 1 and $User/role_id != 12">
                                    <xsl:attribute name="readonly">true</xsl:attribute>
                                </xsl:if>
                            </input>
                        </li>
                    </ul>
	  
                </div>
            </div>
	

            <div class="article">
                <xsl:call-template name="Messages" />

                <fieldset>
                    <ul class="editlist">
                        <li>
                            <label>Роль пользователя</label>
                            <select name="role_id">
                                <xsl:if test="$User/role_id != 1 and $User/role_id != 12">
                                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                                </xsl:if>
                                <xsl:for-each select="Main/form/role_id/row">
                                    <option value="{id}">
                                        <xsl:if test="@active">
                                            <xsl:attribute name="selected">selected</xsl:attribute>
                                        </xsl:if>
                                        <xsl:value-of select="name_full" />
                                    </option>
                                </xsl:for-each>
                            </select>
                        </li>

                        <li>
                            <label>Логин</label>
                            <input name="username" type="text" id="title" value="{Main/form/username}" class="broad100">
                            <xsl:if test="$User/role_id != 1 and $User/role_id != 12">
                                    <xsl:attribute name="readonly">true</xsl:attribute>
                                </xsl:if>
                            </input>
                        </li>


                        <li>
                            <label>Имя</label>

                            <input name="first_name" type="text" value="{Main/form/first_name}"  class="broad100">
                            <xsl:if test="$User/role_id != 1 and $User/role_id != 12">
                                    <xsl:attribute name="readonly">true</xsl:attribute>
                                </xsl:if>
                            </input>
                        </li>

                        <li>
                            <label>Фамилия</label>

                            <input name="last_name" type="text" value="{Main/form/last_name}" class="broad100">
                            <xsl:if test="$User/role_id != 1 and $User/role_id != 12">
                                    <xsl:attribute name="readonly">true</xsl:attribute>
                                </xsl:if>
                            </input>
                        </li>

                        <li>
                            <label>Телефоны</label>
                            <input name="phones" type="text" value="{Main/form/phones}"  class="broad100"/>
                        </li>


                        <li>
                            <label>E-mail</label>
                            <input name="email" type="text" value="{Main/form/email}"  class="broad100"/>
                        </li>
              
                        <li>
                            <label>Пароль</label>

                            <input name="pass1" type="password" value=""   class="broad100"/>

                        </li>
                        <li>
                            <label>Подтвердить</label>
                            <input name="pass2" type="password" value=""   class="broad100"/>
                        </li>


                    </ul>
                    <input name="koatuu" id="koatuu" type="hidden" value="{Main/form/koatuu}" class="broad100"/>



                </fieldset>





            </div>
      
	  
	  
	  
            <div class="submitbox">
                <input name="save" type="submit" id="save"   value="Сохранить" />
            </div>
        </form>
    </xsl:template>

</xsl:stylesheet>